import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

const scrollBehavior = (to, from, savedPosition) => {
	if (savedPosition) {
		return savedPosition
	} else {
		return { x: 0, y: 0 }
	}
}

export default new Router({
	linkActiveClass: 'active',
	scrollBehavior,

	routes: [
		{	path: '/', 
			redirect: '/index'
		},
		{
			path: '/login',
			name: 'login',
			component: resolve => require(['@/pages/login'], resolve)
		},
		{
			path: '/register',
			name: 'register',
			component: resolve => require(['@/pages/register'], resolve)
		},
		{
			path: '/index',
			name: 'index',
			component: resolve => require(['@/pages/index'], resolve)
		},
		{
			path: '/server',
			name: 'server',
			component: resolve => require(['@/pages/copyrightServer'], resolve)
		},
		{
			path: '/file',
			name: 'file',
			component: resolve => require(['@/components/more'], resolve)
		},
		{
			path: '/school',
			name: 'school',
			component: resolve => require(['@/components/more'], resolve)
		},
		{
			path: '/more',
			name: 'more',
			component: resolve => require(['@/components/more'], resolve)
		},
		{
			path: '/development',
			name: 'development',
			component: resolve => require(['@/pages/development'], resolve)
		},
		{
			path: '/cooperation',
			name: 'cooperation',
			component: resolve => require(['@/pages/cooperation'], resolve)
		},
		{
			path: '/partnerApply',
			// component: resolve => require(['@/pages/partnerApply'], resolve)
			component: resolve => require(['@/components/more'], resolve)
		},
		{
			path: '/copyrightregister',
			name: 'copyrightregister',
			component: resolve => require(['@/pages/copyrightregister'], resolve)
		},
		{
			path: '/copyrightMonitoring',
			name: 'copyrightMonitoring',
			component: resolve => require(['@/pages/copyrightMonitoring'], resolve)
		},
		{
			path: '/user',
			name: 'user',
			component: resolve => require(['@/pages/user'], resolve),
			redirect: '/user/crMonitor',
			children: [
				{
					path: '/user/userRegister',
					component: resolve => require(['@/pages/userRegister'], resolve)
				},{
					path: '/user/userRegisterTwo',
					component: resolve => require(['@/pages/userRegister02'], resolve)
				},{
					path: '/user/orderlist',
					component: resolve => require(['@/pages/orderlist'], resolve)
				},{
					path: '/user/crMonitor',
					component: resolve => require(['@/pages/crMonitor'], resolve)
				},{
					path: '/user/crMonitor/:requires_id',
					component: resolve => require(['@/pages/crMDetails'], resolve)
				},{
					path: '/user/userDown',
					component: resolve => require(['@/pages/userDown'], resolve)
				},{
					path: '/user/userinfo',
					component: resolve => require(['@/pages/userinfo'], resolve)
				},{
					path: '/user/identity',
					component: resolve => require(['@/pages/identity'], resolve)
				},{
					path: '/user/obligee',
					component: resolve => require(['@/pages/obligee'], resolve)
				},,{
					path: '/user/password',
					component: resolve => require(['@/pages/password'], resolve)
				},
			]
		},
		{
			path: '/copyRightStep01',
			name: 'copyRightStep01',
			component: resolve => require(['@/pages/copyRightStep01'], resolve)
		},
		{
			path: '/certificate',
			name: 'certificate',
			component: resolve => require(['@/pages/certificate'], resolve)
		},
		{
			path: '/copyRightStep02',
			name: 'copyRightStep02',
			component: resolve => require(['@/pages/copyRightStep02'], resolve)
		},
		{
			path: '/copyRightStep03',
			name: 'copyRightStep03',
			component: resolve => require(['@/pages/copyRightStep03'], resolve)
		},
		{
			path: '/copyRightStep04',
			name: 'copyRightStep04',
			component: resolve => require(['@/pages/copyRightStep04'], resolve)
		},
		// {
		//   path: '/preview',
		//   name: 'preview',
		//   component: resolve => require(['@/pages/preview'], resolve)
		// },
		{
			path: '/monitoringDemand',
			name: 'monitoringDemand',
			component: resolve => require(['@/pages/monitoringDemand'], resolve)
		},
	/* {
		path: '/certificate',
		name: 'certificate',
		component: resolve => require(['@/pages/certificate'], resolve)
		},*/{
			path: '/supplement',
			name: 'supplement',
			component: resolve => require(['@/pages/supplement'], resolve)
		},{
			path: '/finish',
			name: 'finish',
			component: resolve => require(['@/pages/finish'], resolve)
		},
		{
			path: '/copyright',
			name: 'copyright',
			// component: resolve => require(['@/pages/copyright'], resolve),
			component: resolve => require(['@/components/more'], resolve)
		},
		{
			path: '/copyrightlist',
			name: 'copyrightlist',
			component: resolve => require(['@/pages/copyrightlist'], resolve),
		},
		{
			path: '/real',
			name: 'real',
			component: resolve => require(['@/pages/realName'], resolve)
		},
	]
})
